<extend name="category/index" />
<block name="main1">
	<script src="__PUBLIC__/jquery-1.8.3.min.js"></script>
	
</block>
<block name="main">
	<div class="container">
		<center>
			<div class="col-md-8">
				<div class="col-md-5 pull-right">
					<form action="<{:U('ForgetPassword/save')}>" id="form4" method="post">
						<p>
							<h3>手机号码:</h3>
							<input type="text" id="phone" value="<{$_SESSION['home_user']['forgetphone']}>" readonly class="form-control">
						</p>
						<p>
							<h3>密码:</h3> 
							<input type="password" id="userpass3" name="userpass3"class="form-control">
						</p>
						<p>
							<h3>确认密码: </h3>
							<input type="password" id="reuserpass3"class="form-control">
							
						</p>
					</form>
					<button id="tijiao"  class="btn btn-primary">确认提交</button>
							<span id="lala"></span>

				</div>
			</div>
		</center>
	</div>

	<script>
		$(function(){
			$('#tijiao').click(function(){
				var userpass = $('#userpass3').val();
				console.log(userpass);
				var reuserpass = $('#reuserpass3').val();
				console.log(reuserpass);
				if(userpass == ''){
					// alert('密码不能为空');
					$('#lala').css('color','red').html('密码不能为空');
					return false;
				}
				if(reuserpass !=userpass ){
					// alert('确认密码不一样');
					$('#lala').css('color','red').html('确认密码不一样');
					return false;
				} else {
					// alert('sdl');
					var pre_password = /^\w{6,12}$/;
					if(!pre_password.test(userpass)){

					    $('#lala').css('color','red').html('密码6-12位,要以英文和数字');
					    // alert('m');
					    return false;
					} else {
						// alert('dsal');
						$('#form4').submit();

					}
				}

				

				
			})
		})
	</script>
</block>